import request from '@/utils/request'

// 查询参数列表
export function listGuestRoom(query) {
  return request({
    url: '/system/guestRoom/list',
    method: 'get',
    params: query
  })
}

// 查询参数详细
export function getGuestRoom(guestRoomId) {
  return request({
    url: '/system/config/' + guestRoomId,
    method: 'get'
  })
}

// 根据参数键名查询参数值
export function getGuestRoomKey(guestRoomId) {
  return request({
    url: '/system/guestRoom/list',
    method: 'get',
    params: {
      numberId: guestRoomId
    }
  })
}

// 新增参数配置
export function addGuestRoom(data) {
  return request({
    // url: '/system/config',
    url: '/system/guestRoom/add',
    method: 'post',
    data: data
  })
}

// 修改参数配置
export function updateGuestRoom(data) {
  return request({
    url: '/system/guestRoom/update',
    method: 'POST',
    data: data
  })
}

// 删除参数配置
// export function delGuestRoom(configIds) {
//   return request({
//     url: '/system/guestRoom/delete/' + configIds,
//     method: 'post'
//   })
// }
export function delGuestRoom(configId) {
  return request({
    url: '/system/guestRoom/delete',
    method: 'post',
    data:configId
  })
}

// 刷新参数缓存
export function refreshCache() {
  return request({
    url: '/system/config/refreshCache',
    method: 'delete'
  })
}
